package com.tron.dobest.java.tronio;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class TronFileInputStream {
    public static void main(String[] args) throws IOException {
        //读入文件时一般都需要控制大小，因为内存是有限的。
        try (FileInputStream inputStream = new FileInputStream("src/main/java/com/tron/dobest/java/tronio/hello.txt")) {
            byte[] bytes = new byte[1024];
            int read = inputStream.read(bytes);
            String readString = new String(bytes, 0, read, StandardCharsets.UTF_8);
            System.out.println(readString);
        }
    }
}
